#include "Format.h"
#include "VertexLayout.h"

using namespace Stray;
using namespace Stray::Core::Graphics;

namespace Stray {
namespace Core {
namespace Graphics {

Uint32 bitsPerPixel(TextureFormat format)
{
	Uint32 bits = 0;
	switch(format)
	{
	case TF_DXT1:
		bits = 4;
		break;
	case TF_DXT5:
	case TF_A8:
		bits = 8;
		break;
	case TF_A8R8G8B8:
	case TF_A2R10G10B10:
		bits = 32;
		break;
	case TF_A16B16G16R16:
	case TF_A16B16G16R16F:
		bits = 64;
		break;
	case TF_A32B32G32R32F:
		bits = 128;
		break;
	case TF_A1R5G5B5:
	case TF_R5G6B5:
		bits = 16;
		break;
	}
	return bits;
}

Uint32 bitsPerPixel(RenderTargetFormat format)
{
	Uint32 bits = 0;
	switch(format)
	{
	case RTF_A8:
		bits = 8;
		break;
	case RTF_A8R8G8B8:
	case RTF_A2R10G10B10:
		bits = 32;
		break;
	case RTF_A16B16G16R16:
	case RTF_A16B16G16R16F:
		bits = 64;
		break;
	case RTF_A32B32G32R32F:
		bits = 128;
		break;
	}
	return bits;
}

const VertexLayoutTable VERTEX_LAYOUT_TABLE_END = {-1, 0, VLF_Float32x1, VLT_POSITION, 0};

}
}
}